<?
require_once '../../resources/security/security.php';
require_once '../../../classes/product.class.php';
$module_id	= 3;
$module_name = 'Quản lý Đặt mua';
checkLogged();
$bg_errorMsg = '';
$bg_table = 'request_quote';
$id_field = 'rqq_id';
$name_field = 'rqq_cus_name';
$bg_filepath = '../../../pictures/products/';
$bg_extension = 'jpg,jpe,png,gif,jpeg';
$limit_size = 12000;
$arr_resize = array( "small_" => array("quality" => 100, "width" => 141, "height" => 130),
					 "medium_" => array("quality" => 100, "width" => 289, "height" => 261)
					);
function pro_str_name($str_pro_code) {
      $str_pro_id = '0';
      $arr_pro_code = explode(',',$str_pro_code);
      
      foreach($arr_pro_code as $row){
         $pro_id = db_one("SELECT pro_id FROM products WHERE pro_code = '".$row."'");
         if(!$pro_id) return NULL;
         $str_pro_id .= $pro_id.',';
      }
      $str_pro_id = rtrim($str_pro_id,',');
     $arr = db_array('SELECT pro_name
                     FROM products
                     WHERE pro_id IN( '.$str_pro_id.' )');
                     foreach($arr as $row){
                        $str_name .= $row['pro_name'].',';
                     }
                     $str_name = rtrim($str_name,',');
     return $str_name;
   }   
?>